package com.qijian.maindata.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qijian.common.enums.ApprovalDescriptionEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import com.qijian.common.core.domain.BaseEntity;

import java.math.BigDecimal;
import java.util.Date;

/**
 * BOM明细对象 main_bom_detail
 *
 * @author qijian
 * @date 2021-09-01
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@TableName("main_bom_detail")
public class BomDetail extends BaseEntity{
    private static final long serialVersionUID = 1L;

    /** 明细 */
    @TableId
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "明细")
    private Long detailId;

    /** 明细编码 */
    @Excel(name = "明细编码",sort = 2)
    @ApiModelProperty(value = "明细编码")
    private String detailCode;

    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "线路ID")
    private Long lineId;

    @ApiModelProperty(value = "工艺线路编码")
    private String lineCode;

    @ApiModelProperty(value = "子节点数量")
    private Integer subCount;

    @ApiModelProperty(value = "层级")
    private Integer level;

    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "父级")
    private Long pid;

    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "BOM")
    private Long bomId;

    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "物料ID")
    private Long itemId;

    @ApiModelProperty(value = "物料编码")
    private String itemCode;

    @Excel(name = "单套数量" ,sort = 10)
    @ApiModelProperty(value = "单套")
    private Integer quantity;

    /** 用量 */
    @Excel(name = "总数量",sort = 11)
    @ApiModelProperty(value = "用量")
    private BigDecimal totalQuantity;

    /** 顺序 */
    @ApiModelProperty(value = "顺序")
    private Integer sort;

    /** 制作人ID */
    @Excel(name = "制作人ID")
    @JsonSerialize(using= ToStringSerializer.class)
    @ApiModelProperty(value = "制作人ID")
    private Long producerId;

    /** 制作人 */
    @Excel(name = "制作人")
    @ApiModelProperty(value = "制作人")
    private String producerName;

    /** 审核者 */
    @Excel(name = "审核者")
    @ApiModelProperty(value = "审核者")
    private String approvalBy;

    /** 审核时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "审核时间")
    private Date approvalTime;

    /** 审核状态 */
    @Excel(name = "审核状态")
    @ApiModelProperty(value = "审核状态")
    private ApprovalDescriptionEnum approvalStatus;


    @TableField(exist = false)
    private Long detailIdToGetPid;

    private Long createId;

    //是否推送套料软件，默认false
    private Boolean sinoPushed;
}
